﻿using System.Linq;

namespace RestAPI
{
    public class CallBackData
    {
        private string _id;
        private string _callFlowId;
        private string _conFid;
        private string _recordUrl;
        private string _orderId;
        private string _companyId;
        private string _callMode;
        private string _createdTime;
        private string _editedTime;
        private string _thumbnail;
        private string _conFName;
        private string _result;
        private string _number;
        private string _status;
        private string _message;
        private string _success;

        public string id { get { return _id; } set { _id = value; } }
        public string callFlowId { get { return _callFlowId; } set { _callFlowId = value; } }
        public string conFid { get { return _conFid; } set { _conFid = value; } }
        public string recordUrl { get { return _recordUrl; } set { _recordUrl = value; } }
        public string orderId { get { return _orderId; } set { _orderId = value; } }
        public string companyId { get { return _companyId; } set { _companyId = value; } }
        public string callMode { get { return _callMode; } set { _callMode = value; } }
        public string createdTime { get { return _createdTime; } set { _createdTime = value; } }
        public string editedTime { get { return _editedTime; } set { _editedTime = value; } }
        public string thumbnail { get { return _thumbnail; } set { _thumbnail = value; } }
        public string conFName { get { return _conFName; } set { _conFName = value; } }
        public string result { get { return _result; } set { _result = value; } }
        public string number { get { return _number; } set { _number = value; } }
        public string status { get { return _status; } set { _status = value; } }
        public string message { get { return _message; } set { _message = value; } }
        public string success { get { return _success; } set { _success = value; } }

        public override string ToString()
        {
            var properties = this.GetType().GetProperties();
            var propertiesList = properties.Where(o => o.GetValue(this) != null).ToList();
            string toStr = "";
            propertiesList.ForEach(o =>
            {
                toStr += o.GetValue(this) as string + "\r\n";
            });
            return toStr;
        }
    }
}
